package test.yzx.pproject.act2;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.animation.DecelerateInterpolator;

import test.yzx.pproject.R;
import test.yzx.pproject.ViewAnimatorUtil;

public class AnimatorUtilActivity extends AppCompatActivity{

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.a_u_a);

        getWindow().getDecorView().post(new Runnable() {
            public void run() {

                View view = findViewById(R.id.view);
                ViewAnimatorUtil.BoundsChangeParam params = new ViewAnimatorUtil.BoundsChangeParam();

                params.scaleX = 2f;
                params.scaleY = 2f;
                params.rotateZ = 360f;
                params.rotateX = 360f;
                params.rotateY = 360f;
                params.translateY = 200f;
                params.translateX = 200f;
                params.alpha = 0f;

                params.delay = 1000;
                params.duration = 2000;
                params.interpolator = new DecelerateInterpolator(1.9f);

                ViewAnimatorUtil.goBoundsTogether(view, params, new ViewAnimatorUtil.SimpleStatusChangedListener(){});

            }
        });

    }

}
